package com.chen.context;

/**
 * 存储线程信息
 */
public class BaseContext {
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    // 添加线程信息
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }
    // 获取线程信息
    public static Long getCurrentId(){
        return threadLocal.get();
    }

    // 清理线程信息
    public static void removeCurrentId(){
        threadLocal.remove();
    }

}
